<!DOCTYPE html>
<html>
<head>
    <title>{{ room.name }}</title>
    {% set theme =  getThemeProperties(room) %}
    {% if theme %}
        <link rel="shortcut icon" type="image/x-icon" href="{{ theme.icon }}">
    {% else %}
        <link rel="shortcut icon" type="image/x-icon" href="{{ asset('favicon.ico') }}">
    {% endif %}
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    {{ encore_entry_link_tags('join') }}
    {% set theme =  getThemeProperties() %}
    {% if theme is defined and theme != false %}
        <style>
            .blackMode.joinPage .modal-backdrop {
                background-image: radial-gradient({{ theme.colorButton }}, black);
            }

            .joinPage .modal-backdrop {
                background-image: radial-gradient({{ theme.colorButton }}, white);
            }
        </style>
    {% endif %}
</head>
<body style="margin: 0"
      class="{% if app.request.cookies.get('DARK_MODE') is defined and app.request.cookies.get('DARK_MODE') == 1 %}
    blackMode{% endif %} joinPage">

{% set logo_small = httpsAbolutUrl(asset('logo_small.png')) %}

{% if server is defined and  server is not null and server.logoUrl is not null %}
    {% set logo_small =  server.logoUrl %}
{% else %}
    {% if theme == false %}
        {% set logo_small = httpsAbolutUrl(asset('logo_small.png')) %}
    {% else %}
        {% set logo_small = theme.logo %}
    {% endif %}
{% endif %}

{% set logo_large = httpsAbolutUrl(asset('logo.png')) %}

{% if server is defined and  server is not null and server.logoUrl is not null %}
    {% set logo_large =  server.logoUrl %}
{% else %}
    {% if theme == false %}
        {% set logo_large = httpsAbolutUrl(asset('logo_small.png')) %}
    {% else %}
        {% set logo_large = theme.logo %}
    {% endif %}
{% endif %}
{% block sidebar %}
    {% embed('conference_modules/conferenceSidebar.html.twig') with {'room': room} %}
        {% block extension %}
            {% if room.totalOpenRooms == true %}
                {% include 'conference_modules/inviteUsersToOpenRooms.html.twig' with {'url':path('own_room_startPage',{'uid':room.uid})} %}
            {% endif %}

        {% endblock %}
    {% endembed %}
{% endblock %}

<div id="frame">
    {% if room.tag is not null %}
        <p class="floating-tag
{{ getApplicationProperties('LAF_SHOW_TAG_TRANSPARENT_BACKGROUND')==1?'transparent-bg':'' }}
{{ getApplicationProperties('LAF_FLOATING_TAG_FORCE_SHOW')==1?'forceShow':'' }}

" id="tagContent"
           style="color: {{ room.tag.color }}; background-color: {{ room.tag.backgroundColor }}">{{ room.tag.title }}</p>
    {% endif %}
    <div class="w-100" id="jitsiWindow">
        {% include('conference_modules/conference_logo.html.twig') with {'logo_small':logo_small,'logo_large':logo_large} %}
    </div>
</div>


{% include('__checkFirefox.html.twig') with {'room':room} %}
</body>
{% if name is defined and name is not null %}


    <script>
        if ({{ room.server.corsHeader }}) {
            window.top.location.href = "{{ urlFromRoom(user,room, name,'b') }}";
        }
    </script>

    <script src='https://{{ room.server.url }}/external_api.js'></script>
    <script>
        var avatarUrl = '{% if app.user and app.user.profilePicture %}{{ vich_uploader_asset(app.user.profilePicture,'documentFile') }}{% endif %}';
        var setTileview = {{ JITSI_MEET_DEFAULT_TILE_VIEW }};
        var setParticipantsPane = {{ JITSI_MEET_DEFAULT_PARTICIPANTS_PANE }};
        var closeTabText = '{{ 'ask.tab.close'|trans }}';
        const domain = '{{ room.server.url }}';
        const options = {
            roomName: '{{ room.server.slugMd5 }}{{ room.uid }}',

            width: '100%',
            height: 700,
            configOverwrite: {
                {% if server is defined and server.dynamicBrandingUrl %}
                dynamicBrandingUrl: '{{ server.dynamicBrandingUrl }}',
                {% endif %}
                disableBeforeUnloadHandlers: true,
            },
            interfaceConfigOverwrite: {
                MOBILE_APP_PROMO: false,
                SHOW_JITSI_WATERMARK: false,
                HIDE_DEEP_LINKING_LOGO: true,
                {% if server is defined and server.dynamicBrandingUrl %}
                dynamicBrandingUrl: '{{ server.dynamicBrandingUrl }}',
                {% endif %}
                SHOW_BRAND_WATERMARK: false,
            },

            parentNode: document.querySelector('#jitsiWindow'),
            {% if room.server.appId is not null %}
            {% if moderator is not defined %}
            {% set moderator = false %}
            {% endif %}
            jwt: '{{ jwtFromRoom(user,room,name,moderator) }}',
            {% endif %}
            userInfo: {
                displayName: '{{ name }}',
                {% if user is not null and  user.profilePicture is not null %}
                avatarUrl: '{{ vich_uploader_asset(user.profilePicture,'documentFile') }}',
                {% endif %}
            }
        };
        var conferenzeName = '{{ room.name }}';
        var topic = {{ mercure(absolute_url(path('lobby_moderator',{'uid':room.uidReal})))|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_HEX_TAG'))|raw }};
        var topicBroadcast = {{ mercure(absolute_url(path('lobby_broadcast_websocket',{'roomUid':room.uidReal})))|json_encode(constant('JSON_UNESCAPED_SLASHES') b-or constant('JSON_HEX_TAG'))|raw }};
        var websocketTopics = "{{ getJwtforWebsocket(['whiteboard/'~room.uidReal],app.user) }}";
        var websocketUrl = "{{ getUrlforWebsocket() }}";

    </script>


{% endif %}
{% block webpack %}
    {{ encore_entry_script_tags('onlyConference') }}
{% endblock %}

<div class="modal fade" id="loadContentModal"
     data-mdb-backdrop="static"
     data-mdb-keyboard="false"
     tabindex="-1" role="dialog"
     aria-labelledby="loadContentModal"
     aria-hidden="true">
</div>


{% include 'conference_end/__rating.html.twig' with {'room':room} %}

</html>